<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Openfire: Database Installation Guide</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>
<body>

<div id="pageContainer">

<a name="top"></a>

	<div id="pageHeader">
		<div id="logo"></div>
		<h1>Customization Guide</h1>
	</div>
	<div class="navigation">
		<a href="index.html">&laquo; Back to documentation index</a>
	</div>

	<div id="pageBody">

     <p>
        Openfire provides ways to customize application code as well as the Admin console,
        while maintaining that code in a separate location from the distribution source.
        The base code and custom code are integrated during the build process.
     </p>

        <h2><a name="mysql">File Structure</a></h2>

        <p>To cusomize files, create the following file structure in your <tt>openfireHome</tt>
        directory (where all the source files are on your filesystem).
        </p>

<pre>custom/
| - overlay.properties       &lt;- Properties file to replace text in i18n files (optional)
| - source/                  &lt;- Directory to place java source files to be overridden
| - webapp/                  &lt;- Directory to place any web file (image, CSS or jsp)
</pre>

        <p>
            In the <tt>custom/source</tt> directory, mirror the contents under the <tt>src/java</tt> directory.
            Any files you place under <tt>custom/source</tt> will override the current source files in the build.
            For example, to override the
class <tt>org.jivesoftware.openfire.Channel</tt> you would place a Channel.java file under the directory <tt>custom/source/org/jivesoftware/openfire/</tt>
        </p>
        <p>
In the <tt>custom/webapp</tt> directory, mirror the contents of the <tt>src/web</tt> directory.  Any files you place
there will override the current source files in the build.  For example, if you want to modify <tt>src/web/login.jsp</tt>
            then add login.jsp to the directory <tt>custom/webapp</tt>.
           </p>
        <p>
Currently, overridden files will simply be included in the built war or jar files.  We have not added
            functionality to bundle these changes in a separate jar file.
        </p>

        <h2>Overlay Properties File</h2>

        <p>The i18n files have been modified to be as generic as possible (not to mention this project
            by name).  In cases where that could not be avioded, two keys are responsible.  We have
            made it possible to modify these keys by means of an optional properties file, <tt>overlay.properties</tt>
            which you place in your <tt>custom/</tt> folder.  If you want to override these
            default properties just create this file.  The build will continue to work if you haven't
            created the file.
        </p>

        <p>
        The overlay.properties file will currently replace the following keys in the i18n files.
            Note: this properties file should follow the java.util.Properties text file format.
        </p>
        <ul>
            <li><em>title</em> - Title key (usually in the title bar of an HTML page)</li>
            <li><em>short.title</em> - Short title, also used frequently</li>
        </ul>

        <h2>Build</h2>
        <p>Simply build the application as normal.  You may need to run the ant <tt>clean</tt>
            task for your changes to be picked up.
        </p>
    </div>

</div>

</body>
</html>
